package com.example.controller;

import com.example.db.entry.TTest;
import com.example.mapper.TTestMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class TestController {

    @Resource
    private TTestMapper tTestMapper;

    @GetMapping("/test")
    public void update() {
        TTest test = new TTest();
        test.setId(4);
        test.setName("123");
        tTestMapper.updateById(test);
    }

    @GetMapping("/get")
    public List<TTest> get() {
        List<TTest> tTests = tTestMapper.selectList(null);
        return tTests;
    }
}
